//
//  UIButton+Extension.swift
//  Weibo
//
//  Created by 李东 on 15/12/17.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit

extension UIButton {
    
    
    convenience init(title: String, backImageName: String, color: UIColor, fontSize: CGFloat) {

        self.init()
        //设置按钮背景图片
        setBackgroundImage(UIImage(named: backImageName), forState: .Normal)
        //设置按钮文字
        setTitle(title, forState: .Normal)
        //设置文字大小
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        //设置字体颜色
        setTitleColor(color, forState: .Normal)
        //设置大小
        sizeToFit()
        
    }
    
    
    
    
}
